<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@ include file="/WEB-INF/page/include.inc.jsp"%>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/styles/plugins/jqPagination/jqpagination.css">
	<script type="text/javascript" src="<%=request.getContextPath()%>/styles/plugins/jqPagination/jquery.jqpagination.min.js"></script>
	
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/styles/table.css"></link>
	<script type="text/javascript" src="<%=request.getContextPath()%>/styles/table.js"></script>
	
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
	<script>
		$(document).ready(function() {
			$('.pagination').jqPagination({
				current_page: '${page.currentPage}',
				max_page	: '${page.pageCount}',
				page_string : '${page.currentPage}/${page.pageCount}',
				paged		: function(page) {
					$("#currentPage").val(page);
					$("#start").val((page - 1) * 10);
					$("#formId").submit();
				}
			});
		});
	</script>
</head>

<body>
	<div id="ssm-page">
		<form id="formId" action="list" method="post">
			<fieldset>
				<legend>查询条件</legend>
				<input id="currentPage" type="hidden" name="currentPage" value="1"/>
				<input id="start" type="hidden" name="start" value="0"/>
				<span>角色编号:</span><input name="id" value="${role.id}"/>
				<span>角色名称:</span><input name="name"value="${role.name}"/>
				<input id="search" type="submit" class="button" value="查询"/>
			</fieldset>
		</form>
		<div id="buttons">
			<input class="button" type="button" value="新增" onclick="self.top.addTab('新增角色','<%=request.getContextPath()%>/system/role/toAdd','');"/>
			<input class="button" type="button" value="删除" onclick="del('delete');"/>
		</div>
		<table id="tableId">
			<tr>
				<th><input type="checkbox" id="checkAll" onclick="checkAll()"/></th>
				<th>角色编号</th>
				<th>角色名称</th>
				<th>描述</th>
				<th>创建人</th>
				<th>创建时间</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${page.record}" var="role">
				<tr>
					<td><input type="checkbox" name="checkboxs" value="${role.id}"/></td>
					<td>${role.id}</td>
					<td>${role.name}</td>
					<td>${role.describes}</td>
					<td>${role.creater}</td>
					<td><fmt:formatDate value="${role.createTime}" pattern="yyyy/MM/dd HH:mm:ss"/></td>
					<td>
						<a href="javascript:void(0)" onclick="self.parent.addTab('修改角色', '<%=request.getContextPath()%>/system/role/toUpdate?roleId=${role.id}','')">修改</a>
					</td>
				</tr>
			</c:forEach>
		</table>
		
		<div class="pagination" style="width: 100%">
			<a href="#" class="first" data-action="first">&laquo;</a>
			<a href="#" class="previous" data-action="previous">&lsaquo;</a>
			<input type="text" readonly="readonly" />
			<a href="#" class="next" data-action="next">&rsaquo;</a>
			<a href="#" class="last" data-action="last">&raquo;</a>
			显示${page.currentPage}-${page.pageSize}   共${page.count}
		</div>
	</div>
</body>
</html>
